<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>5.functional_component</title>
</head>
<body>
<div id="app">

</div>

<script src="lib/react.development.js"></script>
<script src="lib/react-dom.development.js"></script>
<script src="lib/babel.min.js"></script>
<script type="text/babel">
    /*函数式组件的函数名首字母要大写*/
  function MyComponent(){
      /*这里的this是undefined 因为babel的编译开启了严格模式
      * react调用我们定义的函数是直接调用的，而不是绑定在react上进行调用的*/
      console.log(this);
      return <h1>hello functional component</h1>
  }
  ReactDOM.render(<MyComponent/>,document.getElementById("app"))


</script>
</body>
</html>